package com.nsl.my_youlai.controller;

import com.nsl.my_youlai.common.model.ElSelectOption;
import com.nsl.my_youlai.common.result.Result;
import com.nsl.my_youlai.service.SysRoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/roles")
@RequiredArgsConstructor
public class SysRoleController {

    private final SysRoleService roleService;

    @GetMapping("/options")
    public Result<List<ElSelectOption>> listRoleOptions() {
        List<ElSelectOption> list = roleService.listRoleOptions();
        return Result.success(list);
    }
}
